/*
 * Copyright (c) 2007 jNetX.
 * http://www.jnetx.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * jNetX. You shall not disclose such Confidential Information and
 * shall use it only in accordance with the terms of the license
 * agreement you entered into with jNetX.
 *
 * $Id$
 */
package com.jnetx.javax.sip.address;

import junit.framework.TestCase;

import javax.sip.address.TelURL;
import java.text.ParseException;

/**
 * @author <a href="mailto:dparhonin@jnetx.ru">Dmitry Parhonin</a>
 * @version $Revision$
 */
public class TelURLParserTest extends TestCase {
    public TelURLParserTest(String name) {
        super(name);
    }

    public void testParsing() {
        TelURL url = null;
        TelURLParser parser = new TelURLParser();
        final String urlStr = "tel:+74957807900;ext=115;postd=8";
        try {
            url = parser.parse(urlStr.getBytes(), 0, urlStr.length());
        } catch (ParseException e) {
            fail(e.getMessage());
        }
        assertEquals("The scheme is wrong!", "tel", url.getScheme());
        assertEquals("The phone number is wrong!", "74957807900", url.getPhoneNumber());
        assertEquals("The postdial parameter is wrong!", "8", url.getPostDial());
        assertEquals("The extension parameter is wrong!", "115", url.getParameter("ext"));
    }
}
/*
 * $Log$
 */